package zh.keep.all.services

import android.app.Notification
import android.service.notification.NotificationListenerService
import android.service.notification.StatusBarNotification
import android.util.Log

/**
 * 系统通知
 */
class LiveService : NotificationListenerService() {
    override fun onNotificationPosted(sbn: StatusBarNotification) {
        Log.d("通知", sbn.packageName + "收到通知: " + sbn.notification.extras.getString(Notification.EXTRA_TEXT))
    }

    override fun onNotificationRemoved(sbn: StatusBarNotification) {
        Log.e("通知", sbn.packageName + "移除通知: " + sbn.notification.extras.getString(Notification.EXTRA_TEXT))
    }
}